package com.donleo.jpa.service.impl;

import com.donleo.jpa.entity.DeptEntity;
import com.donleo.jpa.repository.IDeptRepository;
import com.donleo.jpa.service.IDeptServce;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author liangd
 * date 2020-12-04 09:25
 * code
 */
@Service
public class DeptServiceImpl implements IDeptServce {

    @Autowired
    private IDeptRepository deptRepository;

    @Override
    public List<DeptEntity> findAll() {
        /*
         * @Builder的链式调用
         */
        DeptEntity.builder().id(1).deptName("").deptCode("").build();
        return deptRepository.findAll();
    }
}
